package com.mllweb.blog.web.controller;

import com.mllweb.blog.base.BaseController;
import com.mllweb.blog.data.orm.BlogFeedback;
import com.mllweb.blog.data.orm.BlogUser;
import com.mllweb.blog.service.FeedbackService;
import com.mllweb.blog.web.session.SessionKey;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * 意见反馈
 */
@Controller
public class FeedbackController extends BaseController {
    @Autowired
    private FeedbackService feedbackService;
    @RequestMapping(value = "/feedback", method = RequestMethod.GET)
    private String feedback() {
        return "system/feedback";
    }
    @RequestMapping(value = "/feedback", method = RequestMethod.POST)
    private String feedback(BlogFeedback feedback) {
        feedbackService.insert(feedback);
        return redirect("/feedback");
    }
}